home *** CD-ROM | disk | FTP | other *** search
- DEBUG_GROUP(5) Last changed: 3-19-99
-
-
- NNAAMMEE
- DDEEBBUUGG__ggrroouupp - Compiler options for debugging
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- This man page describes the --DDEEBBUUGG:: option to the MIPSpro compilers.
- The DDEEBBUUGG option controls compiler features related to debugging; for
- example, checking for compile or runtime errors, or controlling the
- treatment of error messages.
-
- The DDEEBBUUGG options are supported by the MIPSpro 7.3 compilers for C,
- C++, Fortran 77, and Fortran 90. For information about other compiler
- options, see the cccc(1), CCCC(1), ff7777(1), or ff9900(1) man page.
-
- The following is the command line format used for the DDEEBBUUGG option:
-
- -DEBUG:_o_p_t_i_o_n[[==_v_a_l_u_e]][[::_o_p_t_i_o_n_2[[==_v_a_l_u_e_2]]]]......
-
- The _o_p_t_i_o_n is a name, which can be followed by an equal sign and a
- _v_a_l_u_e. The option names can usually be abbreviated by truncating them
- to a unique prefix. Note that if new options are added, the
- abbreviations may no longer be unique.
-
- Some _o_p_t_i_o_ns are specified with a setting that will enable or disable
- the feature. To enable a feature, specify the option alone or with
- ==11, ==OONN, or ==TTRRUUEE; to disable the feature, specify the option with ==00,
- ==OOFFFF, or ==FFAALLSSEE. This man page only shows the OONN or OOFFFF settings, but
- the other settings are equally valid.
-
- A Boolean option, if used without an optional value, defaults to OONN.
- In the individual descriptions which follow, the default value that is
- stated is the value if the option is not invoked at all.
-
- EErrrroorr DDeetteeccttiioonn aanndd RReeppoorrttiinngg
- The following _o_p_t_i_o_ns are used for error detection and error
- reporting. The option names ending in __cchheecckk generate runtime checking
- code; those ending in __wwaarrnniinngg generate compile-time warnings only.
-
- ccoonnffoorrmm__cchheecckk[[==_s_e_t_t_i_n_g]]
- Determines whether or not conformance checking is enabled.
- When set to YYEESS, the compiler generates code to check for
- conformance of Fortran 90 array operations. Conformance
- check failures generate run-time warnings unless the
- environment variable FF9900__CCOONNFFOORRMM__CCHHEECCKK__AABBOORRTT is set to YYEESS.
- The default is OOFFFF.
-
- Note that the --CC, --cchheecckk__bboouunnddss, and --DDEEBBUUGG::ssuubbssccrriipptt__cchheecckk
- options all enable conformance checking. This option is
- accepted by the MIPSpro 7 Fortran 90 compiler only.
-
- ddiivv__cchheecckk[[==_n]]
- Emit code to check all integer divides for zero divisors or
- overflow, using these rules for values of _n:
-
- ==00 Do no checks
-
- ==11 Check for divide by zero
-
- ==22 Check for overflow (for example, IINNTT__MMAAXX--11)
-
- ==33 Check both divide by zero and overflow
-
- This option replaces --TTEENNVV::cchheecckk__ddiivv. The default is _n==11.
-
- ssuubbssccrriipptt__cchheecckk[[==_s_e_t_t_i_n_g]]
- Generate code to check for subscripts out of range at
- runtime. _s_e_t_t_i_n_g can be either OONN or OOFFFF. This produces a
- ttrraapp ##88 (C and C++) or an aabboorrtt (FORTRAN 77) for violations
- at runtime unless --DDEEBBUUGG::vveerrbboossee__rruunnttiimmee is also specified.
- The default is _s_e_t_t_i_n_g==OONN.
-
- This does not produce an abort for Fortran 90 or Fortran 95
- programs unless the FF9900__BBOOUUNNDDSS__CCHHEECCKK__AABBOORRTT environment
- variable is set to YYEESS.
-
- ttrraapp__uunniinniittiiaalliizzeedd[[==_s_e_t_t_i_n_g]]
- Force all uninitialized stack, automatic and dynamically
- allocated variables to be initialized with 00xxFFFFFFAA55AA55AA.
- _s_e_t_t_i_n_g can be OONN or OOFFFF. When this value is used as a
- floating point variable, it is treated as a floating point
- NaN and it causes a floating point trap. When it is used as
- a pointer, an address or segmentation violation usually
- occurs. This option replaces --ttrraappuuvv. The default is
- _s_e_t_t_i_n_g==OOFFFF.
-
- vvaarraarrggss__iinntteerrffaaccee__cchheecckk[[==_s_e_t_t_i_n_g]]
- Emit subprogram interface descriptors for all eexxtteerrnn vvaarraarrggss
- definitions (C and C++) and calls to non-prototyped routines
- with actual parameters, and check the calls in the linker
- and rrlldd for consistency. The default is _s_e_t_t_i_n_g==OONN.
-
- vvaarraarrggss__pprroottoottyyppeess[[==_s_e_t_t_i_n_g]]
- Set vvaarraarrgg prototype. ANSI C and C++ require that vvaarraarrggss
- routines be prototyped, and the compiler assumes this by
- default. Failure to provide prototypes for calls to such
- routines with floating point arguments usually causes
- failures. Turning _s_e_t_t_i_n_g to OOFFFF eliminates these failures
- at some cost in program performance. The compiler and/or
- linker usually produces warnings for programs which might
- encounter this problem to assist in fixing the problems.
- The default is _s_e_t_t_i_n_g==OONN.
-
- vveerrbboossee__rruunnttiimmee[[==_s_e_t_t_i_n_g]]
- Modify the behavior of various runtime checks to report
- source routine and line number of failures instead of just
- reporting trapping. This increases the code size impact of
- checking, but provides better information. The default is
- _s_e_t_t_i_n_g==OOFFFF.
-
- MMeessssaaggee ccoonnttrrooll ooppttiioonnss
- Messages are classified as follows:
-
- * _d_i_s_c_r_e_t_i_o_n_a_r_y _e_r_r_o_r_s, which can be turned off
-
- * _e_r_r_o_r_s, for problems which cause the compilation to fail
-
- * _w_a_r_n_i_n_g_s, for situations which are likely to be programmer errors
-
- * _r_e_m_a_r_k_s, for situations which might be problems
-
- By default, the compiler prints error and warning messages, but not
- remarks. Most compiler messages have an identifying number (the
- _m_e_s_s_a_g_e _I_D), which is printed in parentheses after the classification;
- this message ID number can be used in the options described here.
-
- Most error messages cannot be controlled; they are emitted, and the
- compiler rejects the file being compiled.
-
- The following _o_p_t_i_o_ns are used for message control.
-
- eerrrroorr==_I_D_1[[,,_I_D_2,,......]]
- Treat the problems reported by warnings or remarks with
- message IDs _I_D_1, _I_D_2, etc., as errors.
-
- ffuullllwwaarrnn[[==_s_e_t_t_i_n_g]]
- Emit all informational messages, including remarks. _s_e_t_t_i_n_g
- can be OONN or OOFFFF. The default is OOFFFF.
-
- rreemmaarrkk==_I_D_1[[,,_I_D_2,,......]]
- Treat the problems with message IDs _I_D_1, _I_D_2, etc., as
- remarks (that is, do not print them unless
- --DDEEBBUUGG::ffuullllwwaarrnn==OONN. This option is not accepted by the
- MIPSpro 7 Fortran 90 compiler.
-
- ssuupppprreessss==_I_D_1[[,,_I_D_2,,......]]
- Suppress the messages with IDs _I_D_1, _I_D_2, etc. This has the
- same effect as --DDEEBBUUGG::wwooffff==.
-
- wwaarrnniinngg==_I_D_1[[,,_I_D_2,,......]]
- Treat the problems with message IDs _I_D_1, _D_2, etc., as
- warnings.
-
- wwooffff==_I_D_1[[,,_I_D_2,,......]]
- Turn off the messages with IDs _I_D_1, _I_D_2,... Has the same
- effect as --DDEEBBUUGG::ssuupppprreessss==.
-
- RRuunnttiimmee EErrrroorr RReeppoorrttiinngg
- Many of the --DDEEBBUUGG options support the detection of errors at runtime.
- For example, --DDEEBBUUGG::ssuubbssccrriipptt__cchheecckk can "report" the errors either
- with a simple trap which doesn't require much code, or with a more
- expensive library call which identifies the offending routine and line
- number. The latter choice is enabled by the --DDEEBBUUGG::vveerrbboossee__rruunnttiimmee
- option.
-
- The reporting routine is named ____CC__rruunnttiimmee__eerrrroorr. Setting a debugger
- breakpoint at this routine is a good way to obtain further information
- about the runtime errors it reports. However, ____CC__rruunnttiimmee__eerrrroorr is
- not available in lliibbcc..ssoo in versions of Irix prior to 6.5. A core
- dump with memory failure may occur in C or C++ programs run under
- pre-IRIX 6.5 OS versions, if the programs are compiled with
- --DDEEBBUUGG::ssuubbssccrriipptt__cchheecckk::vveerrbboossee__rruunnttiimmee and they encounter a subscript
- range violation. In these cases, the programs will dump core with a
- memory failure instead of reporting the error location.
-
- If you provide your own dummy ____CC__rruunnttiimmee__eerrrroorr, you can set a
- debugger breakpoint at it to locate errors. Furthermore, you can
- obtain a location report for this purpose by providing a routine
- similar to this example:
-
- ========================================================
- #include <signal.h>
- #include <stdio.h>
-
- void __C_runtime_error ( int trap_code, char *name, int line_no, ... )
- {
- switch ( trap_code ) {
- /* Subscript range violations: */
- case BRK_RANGE:
- fprintf ( stderr, "error: Subscript range violation", name);
- break;
-
- /* Others (unknown trap codes): */
- default:
- fprintf ( stderr, "error: Trap %d ", trap_code );
- break;
- }
-
- fprintf ( stderr, " in '%s'", name);
- if ( line_no != -1 )
- fprintf ( stderr, " (line %d)", line_no );
- fprintf ( stderr, "0 );
- exit (99);
- }
- ========================================================
-
- SSEEEE AALLSSOO
- cccc(1), CCCC(1), ff7777(1), ff9900(1)
-
- This man page is available only online.
-